
#include <tchar.h>
#include "SerialPort.h"
using namespace std;
#include <iostream>
int _tmain(int argc, _TCHAR* argv[])
{

	CSerialPort mySerialPort;

	if (!mySerialPort.InitPort(20))
	{
		std::cout << "initPort fail !" << std::endl;
	}
	else
	{
		std::cout << "initPort success !" << std::endl;
	}



	if (!mySerialPort.OpenListenThread())
	{
		std::cout << "OpenListenThread fail !" << std::endl;
	}
	else
	{
		std::cout << "OpenListenThread success !" << std::endl;
	}

	unsigned char abc[] = "123456";
	int t = 0;
	mySerialPort.WriteData(abc, 3);
	while (t)
	{
		mySerialPort.WriteData(abc, 3);
		Sleep(1000);
	}



	int temp;
	std::cin >> temp;

	return 0;
}
